package cn.gz.lbs.jobs;

import java.util.Collection;

import java.util.Iterator;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.Scheduler;
import org.quartz.StatefulJob;
import org.quartz.impl.StdSchedulerFactory;


public class NowLtrrListenJob implements StatefulJob {
	private static final Log log = LogFactory.getLog(NowLtrrListenJob.class);

	public void execute(JobExecutionContext context)
			throws JobExecutionException {
		String scName = "";
		try {
			StdSchedulerFactory sf = new StdSchedulerFactory();
			@SuppressWarnings("unchecked")
			Collection<Scheduler> list = sf.getAllSchedulers(); 
			
			Iterator<Scheduler> it = list.iterator();
			while(it.hasNext()){

				Scheduler sc = it.next();
			  if(sc != null){
				  scName = scName+";"+sc.getSchedulerName();
			  }
			  }
			log.info("nowAllSchedulerNameHere:"+scName);
		} catch (Exception ex) {
			log.error("NowLtrrListenJobException:", ex);
		}
	}

}
